package com.ccc.dingtalk.constant;

/**
 * 打卡结果枚举类
 *
 * @author superC
 * @version 1.0.0
 * @date 2023-08-08
 */

public enum TimeResultEnum {

    /**
     *打卡结果：
     *
     * Normal：正常
     * Early：早退
     * Late：迟到
     * SeriousLate：严重迟到
     * Absenteeism：旷工迟到
     * NotSigned：未打卡
     */

    NORMAL("Normal", "正常"),

    EARLY("Early", "早退"),

    LATE("Late", "迟到"),

    SERIOUSLATE("SeriousLate", "严重迟到"),

    ABSENTEEISM("Absenteeism", "旷工迟到"),

    NOTSIGNED("NotSigned", "未打卡")

    ;

    /**
     * 英文标识
     */
    private final String mark;

    /**
     * 中文显示
     */
    private final String label;

    TimeResultEnum(String mark, String label) {
        this.mark = mark;
        this.label = label;
    }

    public String getMark() {
        return mark;
    }

    public String getLabel() {
        return label;
    }

    public static String getLabel(String mark) {
        for (TimeResultEnum item : TimeResultEnum.values()) {
            if (item.getMark().equals(mark)) {
                return item.getLabel();
            }
        }
        return TimeResultEnum.NORMAL.getLabel();
    }
}
